<?php
class Hello_Controller extends TinyMVC_Controller
{
  function index($name=null)
  {
  	echo '-----<br />';
  	echo $name, '<br />';
  	$output = $this->view->fetch('hw_view');
  	$this->view->assign('hw', $output);
  	$data['title'] = 'Hello';
	$data['body_text'] = 'Hello world.';
	$this->view->assign('data',$data);

    $this->view->display('hello_view');
  }
  
  function mytime($p='www'){
//  	global $tmvc;
  	$this->load->model('Page_Model', 'page');
//  	var_dump($this->uri->path[1]);
//  	var_dump($tmvc);
//  	$t = $this->page->get_title($tmvc->url_segments[3]);
  	$t = $this->page->get_title($this->uri->path[1]);
  	$this->view->assign('title', $t);
//  	
//  	$this->load->library('demo', 'mydemo');
//  	$this->view->assign('output', $this->mydemo->test());
//
//	$this->load->library('demo','mydemo');
//    $this->view->assign('output', $this->mydemo->test());
  	
  	$this->view->display('mytime_view');
  }
  
  function bloglist(){
  	$this->load->model('Blog_Model', 'blog');
  	
  	//$data = $this->page->bloglist();
  	$data=$this->blog->get_blog();
  	$this->view->assign('data', $data);
  	$this->view->display('bloglist_view');
  	
  }
}

?>
